/*
 * @Author: feng.gan 675198494@qq.com
 * @Date: 2024-07-17 14:47:34
 * @LastEditors: feng.gan 675198494@qq.com
 * @LastEditTime: 2025-06-03 09:45:04
 * @FilePath: \vue3-demo\vite.config.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import eslintPlugin from 'vite-plugin-eslint'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    // monacoEditorPlugin({}),
    vue(),
    AutoImport({
      resolvers: [ElementPlusResolver()] // api
    }),
    Components({
      resolvers: [ElementPlusResolver()] // 组件
    }),
    // eslintPlugin({
    //   cache: false, // 禁用缓存
    //   fix: true, // 自动修复问题
    //   lintOnStart: true, // 启动时进行校验
    //   include: ['src/**/*.js', 'src/**/*.vue'], // 明确指定需要检查的文件
    //   // exclude: ['node_modules', 'dist', '**/*.config.js'] // 排除 dist 文件夹
    // })
  ],
  resolve: {
    alias: {
      '@': path.resolve(__dirname,'./src')
    }
  },
  css: {
    preprocessorOptions: {
      less: {
        additionalData: '@import "@/styles/variables.less";'
      }
    }
  }
})
